//
//  IMTHTTPSessionManager.h
//  INMOTION
//
//  Created by Kyle on 3/5/15.
//  Copyright (c) 2015 Inmotion. All rights reserved.
//

#import "AFHTTPSessionManager.h"

extern NSString * const IMTHTTPSessionErrorDomain;
extern NSString * const kIMTReleaseBaseUrl;
extern NSString * const kIMTDevelopmentBaseUrl;
extern NSString * const IMTUseDevelopmentRequestUrlKey;

extern const NSInteger IMTHTTPSessionManagerRequestCancelCode;
extern const NSInteger IMTHTTPSessionManagerAuthorizationFailedCode;

@interface IMTHTTPSessionManager : AFHTTPSessionManager

@property (nonatomic, copy) NSString *baseUrl;
@property (nonatomic, copy) NSString *apiUrl;
@property (nonatomic, copy) NSString *lbsUrl;
@property (nonatomic, copy) NSString *memberUrl;
@property (nonatomic, copy) NSString *languageShortString;
@property (nonatomic, assign) BOOL reloginAlertShowing;

+ (instancetype)sharedInstance;

- (void)configUrl;

- (void)cancelAllTasks;

- (NSURLSessionDataTask *)ks_POST:(NSString *)URLString
                       parameters:(id)parameters
                          success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                          failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (NSURLSessionDataTask *)lbs_POST:(NSString *)URLString
                       parameters:(id)parameters
                          success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                          failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

- (NSURLSessionDataTask *)ks_POST:(NSString *)URLString
                       parameters:(id)parameters
        constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> formData))block
                          success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                          failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (NSURLSessionDataTask *)lbs_POST:(NSString *)URLString
                       parameters:(id)parameters
        constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> formData))block
                          success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                          failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

- (NSURLSessionUploadTask *)ks_uploadTaskWithStreamedRequest:(NSURLRequest *)request
                                                    progress:(NSProgress *__autoreleasing *)progress completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;

- (NSURLSessionDataTask *)gy_POST:(NSString *)URLString
                       parameters:(id)parameters
                          success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                          failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
@end
